package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_test_content", schema = "test", catalog = "")
public class TestContent {
    private int id;
    private int testId;
    private int tmId;
    private String score;
    private int titleNo;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "test_id", nullable = false)
    public int getTestId() {
        return testId;
    }

    public void setTestId(int testId) {
        this.testId = testId;
    }

    @Basic
    @Column(name = "tm_id", nullable = false)
    public int getTmId() {
        return tmId;
    }

    public void setTmId(int tmId) {
        this.tmId = tmId;
    }

    @Basic
    @Column(name = "score", nullable = false, length = 8)
    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    @Basic
    @Column(name = "title_no", nullable = false)
    public int getTitleNo() {
        return titleNo;
    }

    public void setTitleNo(int titleNo) {
        this.titleNo = titleNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestContent that = (TestContent) o;

        if (id != that.id) return false;
        if (testId != that.testId) return false;
        if (tmId != that.tmId) return false;
        if (titleNo != that.titleNo) return false;
        if (score != null ? !score.equals(that.score) : that.score != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + testId;
        result = 31 * result + tmId;
        result = 31 * result + (score != null ? score.hashCode() : 0);
        result = 31 * result + titleNo;
        return result;
    }
}
